test: ignore stale AI agents init prompts during sample download#9102
Conversation
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
|
/azp run azure-dev - live - ext - azure.ai.agents |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR updates the Azure AI Agents Tier 2 live E2E console driver to avoid misclassifying already-answered Survey prompts as “active” when init progress output appears after them (e.g., during slower GitHub sample downloads), preventing false “prompt loop” failures.
Changes:
- Extend prompt detection to ignore
?prompt lines when init progress output is present after the prompt. - Add init-progress heuristics that recognize GitHub sample download/copy/adoption output lines.
jongio
left a comment
There was a problem hiding this comment.
The new hasInitProgressAfterPrompt trips the required lint / go-fix check, which is currently red and blocking merge. The file is build-tagged //go:build linux, so go fix only flags it on Linux (a local Windows run passes, which is easy to miss). Running go fix ./... with GOOS=linux in cli/azd/extensions/azure.ai.agents rewrites the manual loop to slices.ContainsFunc and adds the slices import.
jongio
left a comment
There was a problem hiding this comment.
The go-fix rewrite I flagged is in: hasInitProgressAfterPrompt now uses slices.ContainsFunc with the slices import, and the required lint / go-fix check is green. Approving to clear my earlier comment.
|
/azp run azure-dev - live - ext - azure.ai.agents |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jongio
left a comment
There was a problem hiding this comment.
The new commit adds isAnsweredTemplatePrompt and two focused unit tests for activePrompt (answered select without choices, active select with choices). The lint / go-fix check I flagged earlier is green. Re-approving against the current HEAD (2d1c700).
|
/azp run azure-dev - live - ext - azure.ai.agents |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run azure-dev - live - ext - azure.ai.agents |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run azure-dev - live - ext - azure.ai.agents |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run azure-dev - live - ext - azure.ai.agents |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jongio
left a comment
There was a problem hiding this comment.
Reviewed the latest test-driver changes against 77a867d. The runner now strips unusable GITHUB_TOKEN/GH_TOKEN from its env and validates a token with gh auth status before using it, and init still fails fast when it reaches an interactive GitHub CLI auth prompt, including the non-? device-login line. The withoutGitHubTokenEnv helper allocates a fresh slice instead of aliasing os.Environ(). Covered by the new activePrompt and isGitHubAuthPrompt unit tests. Re-approving against the current HEAD.
|
/check-enforcer evaluate |
trangevi
left a comment
There was a problem hiding this comment.
Decided that my questions don't need to be considered blocking
Fixes #9101
Summary
azd initprogress appears after them.init stuck in prompt loopfailures when survey leaves an answered starter/agent-template prompt visible on the PTY screen during sample download/copy.ghbrowser/device login in CI.Root cause
? select a starter templateline on screen whileazd initcontinues downloading and copying the sample.Downloading sample from GitHub,azure.yaml, orsrc/....GH_TOKEN/GITHUB_TOKENcan be invalid. Retrying without validating token state letsghfall back to interactive auth prompts or fail later during sample adoption.?line, so the driver must classify auth/device-login lines explicitly instead of waiting for a survey prompt.Fix details
activePromptnow treats answered prompts followed by init progress as stale.azd, and avoids poisoning later test modes with an unusable token.phaseInitWithRetrywas renamed tophaseInitWithTokenCheckto reflect that it now classifies token failures rather than retrying.?GitHub device-login lines.Why this surfaced now
/azp run azure-dev - live - ext - azure.ai.agentscan start PR comment-triggered runs.Validation
Local:
gofmt -w tests/e2e-live/console_test.go tests/e2e-live/tier2_live_test.gogo test -count=1 ./tests/e2e-live/GOOS=linux GOARCH=amd64 GOTOOLCHAIN=go1.26.4 go fix -diff ./...GOOS=linux GOARCH=amd64 GOTOOLCHAIN=go1.26.4 go test -c ./tests/e2e-live/CI / live:
77a867d4: build 6552884.77a867d4.77a867d4: build 6552933.77a867d4: build 6552980.ghbrowser auth), and 6552245 (invalid inherited token reused in the next mode).